[Unit]
Description=Hadoop Job History
After=network.target

[Service]
Type=forking
User={{ owner }}
Group={{ group }}
Restart=on-failure
RestartSec=30
Environment=HADOOP_LOG_DIR={{ soft_log_path }}/hadoop
ExecStart=/bin/bash -c "source /home/{{ owner }}/.bashrc && {{ hadoop_install_path }}/hadoop/sbin/mr-jobhistory-daemon.sh start historyserver"
ExecStop=/bin/bash -c "source /home/{{ owner }}/.bashrc && {{ hadoop_install_path }}/hadoop/sbin/mr-jobhistory-daemon.sh stop historyserver"
LimitCORE=infinity
CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK CAP_SYS_NICE

[Install]
# Hadoop Job History should not start from the rescue shell (rescue.target).
WantedBy=multi-user.target
